﻿<%@ Page Title="" Language="C#" MasterPageFile="~/staffpages/MasterPageStaff.master" AutoEventWireup="true" CodeFile="ManageStudent.aspx.cs" Inherits="staffpages_ManageStudent" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2 style="text-align:center">Manage Student</h2>
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="stu_ID" DataSourceID="SqlDataSourceStudent" ForeColor="#333333" GridLines="None" Width="100%">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
            <asp:BoundField DataField="stu_ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="stu_ID" />
            <asp:BoundField DataField="stu_username" HeaderText="username" SortExpression="stu_username" />
            <asp:BoundField DataField="stu_fullname" HeaderText="fullname" SortExpression="stu_fullname" />
            <asp:BoundField DataField="stu_studentcode" HeaderText="studentcode" SortExpression="stu_studentcode" />
            <asp:BoundField DataField="ad_email" HeaderText="email" SortExpression="ad_email" />
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSourceStudent" runat="server" ConnectionString="<%$ ConnectionStrings:EnviromentSurvey_S3ConnectionString %>" DeleteCommand="DELETE FROM [StudentAccount] WHERE [stu_ID] = @stu_ID" InsertCommand="INSERT INTO [StudentAccount] ([stu_username], [stu_fullname], [stu_studentcode], [ad_email]) VALUES (@stu_username, @stu_fullname, @stu_studentcode, @ad_email)" SelectCommand="SELECT [stu_ID], [stu_username], [stu_fullname], [stu_studentcode], [ad_email] FROM [StudentAccount]" UpdateCommand="UPDATE [StudentAccount] SET [stu_username] = @stu_username, [stu_fullname] = @stu_fullname, [stu_studentcode] = @stu_studentcode, [ad_email] = @ad_email WHERE [stu_ID] = @stu_ID">
        <DeleteParameters>
            <asp:Parameter Name="stu_ID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="stu_username" Type="String" />
            <asp:Parameter Name="stu_fullname" Type="String" />
            <asp:Parameter Name="stu_studentcode" Type="String" />
            <asp:Parameter Name="ad_email" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="stu_username" Type="String" />
            <asp:Parameter Name="stu_fullname" Type="String" />
            <asp:Parameter Name="stu_studentcode" Type="String" />
            <asp:Parameter Name="ad_email" Type="String" />
            <asp:Parameter Name="stu_ID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>

